package com.yq.homework.day25;



import java.io.*;


/**
 * @author 3307235355@qq.com
 * @since 2022/06/25 15:46
 *
 * 利用字符流去读取一个文本文件，
 * 每次读取一行，并将这行数据逆序，
 * 入新的文本文件当中
 */
public class Demo01 {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new FileReader("a.txt"));
        BufferedWriter out = new BufferedWriter(new FileWriter("b1.txt"));
        String s ;
        while ((s= in.readLine())!=null){
            StringBuffer s2 = new StringBuffer(s);
            s2.reverse();
            String s3 = s2.toString();
            out.write(s3);
            out.newLine();
        }
        in.close();
        out.close();

    }
}
